package mest.controller.hank;

import mest.entity.plan_productjob_saleout_record;
import mest.entity.plan_productjob_takematerial_record;
import mest.service.hank.PlanProductjobTakematerialRecordService;
import mest.util.ResultObj;
import mest.util.mestUtil;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * @Classname PlanProductjobTakemarterialRecord
 * @Description TODO
 * @Date 2019/12/13 18:24
 * @Created by 18416
 * @Auther: henk
 */
@RestController
@RequestMapping("/PlanProductjobTakemarterialRecord")
@CrossOrigin
public class PlanProductjobTakemarterialRecord {
    //本类
    @Resource
    private PlanProductjobTakematerialRecordService ppjtr;
    
    /**
     * 出库修改操作日志和 生成仓库单
     * @param json
     * @param request
     * @return
     */
    @RequestMapping("/inserList")
    public ResultObj inserList(@RequestBody JSONObject json,HttpServletRequest request ){
    	try {
        	Map<String, Object> map = json.toJavaObject(Map.class);
            map.put("theirDb", mestUtil.getCompanyDB(request));
            System.out.println("map"+map.toString());
            int i = ppjtr.intsertList(map);
            return ResultObj.createSuccessMsg(ResultObj.INSERT_SUCCESS);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			return ResultObj.createError();
		}
    }
}
